/*
** Copyright (C) 2010 Calin Radoni
**
** This file is part of CHScanner.
**
** CHScanner is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** CHScanner is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with CHScanner. If not, see <http://www.gnu.org/licenses/>.
*/

#include "StdAfx.h"
#include "MLEVRecord.h"

//---------------------------------------------------------------------------

MLEVRecord::MLEVRecord(void)
{
	Initialize();
}

MLEVRecord::~MLEVRecord(void)
{
}

//---------------------------------------------------------------------------

void MLEVRecord::Initialize(void)
{
	xLength = 0;
	xEvent  = 0;
	xValue[0] = xValue[1] = 0;
}

//---------------------------------------------------------------------------

void MLEVRecord::LoadFromPointer(MLEVRecord* recordIn)
{
	xLength   = recordIn->xLength;
	xEvent    = recordIn->xEvent;
	xValue[0] = recordIn->xValue[0];
	xValue[1] = recordIn->xValue[1];
}

//---------------------------------------------------------------------------

bool MLEVRecord::IsEmpty(void)
{
	return xLength==0 ? true : false;
}

bool MLEVRecord::IsEqualWith(MLEVRecord* recordIn)
{
	if(recordIn==NULL) return false;

	if(xLength  !=recordIn->xLength)   return false;
	if(xEvent   !=recordIn->xEvent)    return false;
	if(xValue[0]!=recordIn->xValue[0]) return false;
	if(xValue[1]!=recordIn->xValue[1]) return false;

	return true;
}

//---------------------------------------------------------------------------
